package edu.tyut.game.ui.user.password

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.switchMap
import edu.tyut.game.logic.UserRepository
import edu.tyut.game.logic.model.User

class ConfirmPasswordViewModel : ViewModel() {

    var user: User ?= null
    private val userLiveData = MutableLiveData<User>()
    val isSuccess = userLiveData.switchMap {
        UserRepository.updatePassword(it)
    }
    fun updatePassword(user: User){
        userLiveData.value = user
    }
}